package cn.ruanyun.backInterface.modules.fadada.controller;

import cn.ruanyun.backInterface.common.utils.PageUtil;
import cn.ruanyun.backInterface.common.utils.ResultUtil;
import cn.ruanyun.backInterface.common.vo.PageVo;
import cn.ruanyun.backInterface.common.vo.Result;
import cn.ruanyun.backInterface.modules.fadada.dto.PushTwoElectronicContractDto;
import cn.ruanyun.backInterface.modules.fadada.pojo.MyContractSigning;
import cn.ruanyun.backInterface.modules.fadada.service.IMyContractSigningService;
import com.google.api.client.util.Maps;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;
import java.util.Optional;

/**
 * @author z
 * 我的合同签署管理接口
 */
@Slf4j
@RestController
@RequestMapping("/ruanyun/myContractSigning")
@Transactional
@Api(tags = "我的填充合同")
public class MyContractSigningController {

    @Autowired
    private IMyContractSigningService iMyContractSigningService;


    @PostMapping("/getMyContractSigning")
    @ApiOperation("获取我的合同签署")
    public Result<MyContractSigning> getMyContractSigning() {

        return iMyContractSigningService.getMyContractSigning();
    }

    @PostMapping("/signContract")
    @ApiOperation("填充合同")
    public Result<Object> signContract(PushTwoElectronicContractDto pushTwoElectronicContractDto) {

        return iMyContractSigningService.signContract(pushTwoElectronicContractDto);
    }

    @PostMapping("/partyOneExtSign")
    @ApiOperation("甲方手动签署")
    public Result<Object> partyOneExtSign(String id) {

        return iMyContractSigningService.partyOneExtSign(id);
    }

    @PostMapping("/partyTwoExtSign")
    @ApiOperation("乙方方手动签署")
    public Result<Object> partyTwoExtSign() {

        return iMyContractSigningService.partyTwoExtSign();
    }


}
